|
Responsibility-driven design is a design technique in object-oriented programming. It was proposed by Rebecca Wirfs-Brock and Brian Wilkerson, who defined it as follows:
Responsibility-driven design is in direct contrast with data-driven design, which promotes defining the behavior of a class along the data that it holds. Data-driven design is not the same as data-driven programming, which is concerned with using data to determine control flow not class design. The client/server model they refer to assumes that a software client and a software server exchange information based on a contract that both parties commit to adhere to. The client may only make the requests specified, the server must answer them. Thus, responsibility-driven design tries to avoid dealing with details, such as the way in which requests are carried out, by instead only specifying the intent of a certain request. The benefit is increased encapsulation, since the specification of the exact way in which a request is carried out is private to the server. To further the encapsulation of the server, Wirfs-Brock and Wilkerson call for language features that limit outside influence to the behavior of a class. They demand that visibility of members and functions should be finely grained, such as in Eiffel. Even finer control of the visibility of even classes is available in the Newspeak programming language. ==Building blocks== In their book ''Object Design: Roles, Responsibilities and Collaborations'', the authors describe the following building blocks that make up responsibility-driven design. * Application : A software application is referred to as a set of interacting objects〔 * Candidates : Candidates or candidate objects are key concepts in the form of objects described on CRC cards. They serve as initial inventions in the process of object design. * Collaborations : A collaboration is defined as an interaction of objects or roles (or both).〔 * CRC Cards : CRC stands for Candidates, Responsibilities, Collaborators. They are index cards used in early design for recording candidates. These cards are split up into an unlined and a lined side. * * Content of lined side : On this side the candidate's name, its responsibilities and its collaborators are recorded.〔 * * Content of unlined side : On this side the candidate's name, its purpose in the application, stereotype roles and anything worthwhile such as the names of roles in patterns it participates in are recorded.〔 * Hot Spots : Hot Spots are points in the application where variations occur. They are recorded using Hot Spot Cards. * Hot Spot Cards : Hot Spot Cards are used for recording variations, so called hot spots. They are similarly to CRC cards low-level tools in the form of index cards.〔 These cards consist of: * * Hot Spot Name * * General description of the variation * * At least two specific examples where the variation occurs 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Responsibility-driven design」の詳細全文を読む スポンサード リンク
|